package com.budwk.app.miniapp.models;

import cn.hutool.core.util.IdUtil;
import com.alibaba.excel.annotation.ExcelProperty;
import com.budwk.app.miniapp.common.excel.ExcelDictConvert;
import com.budwk.starter.common.openapi.annotation.ApiModel;
import com.budwk.starter.common.openapi.annotation.ApiModelProperty;
import lombok.Data;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;

import java.io.Serializable;
import java.util.Date;

/**
 * 事件对象 wx_event
 *
 * @author dfxy
 * @date 2023-02-20
 */
@Data
@Table("wx_event")
@ApiModel(description = "事件对象表")
public class WxEvent implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 订单单号
     */
    @Name
    @Column
    @Comment("订单单号")
    @ApiModelProperty(description = "订单单号")
    @Prev(els=@EL("$me.nextId()"))
    @ColDefine(type = ColType.VARCHAR, width = 64)
    private String id;

    /**
     * 事件发起人id
     */
    @Column
    @Comment("事件发起人id")
    @ApiModelProperty(description = "事件发起人id")
    @ColDefine(type = ColType.VARCHAR, width = 64)
    @ExcelProperty(value = "事件发起人id")
    private String openid;

    /**
     * 事情发起人姓名
     */
    @Column("user_name")
    @Comment("事件发起人id")
    @ApiModelProperty(description = "事件发起人id")
    @ColDefine(type = ColType.VARCHAR, width = 64)
    @ExcelProperty(value = "事件发起人姓名")
    private String userName;

    /**
     * 事情类型
     */
    @Column("event_type")
    @Comment("事情类型")
    @ApiModelProperty(description = "事情类型")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    @ExcelProperty(value = "事件类型(自然灾害、应急事件、其它事件，其它)", converter = ExcelDictConvert.class)
    private String eventType;

    /**
     * 标题
     */
    @Column("event_Title")
    @Comment("事情类型")
    @ApiModelProperty(description = "事情类型")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    private String eventTitle;

    /**
     * 事情内容详情
     */
    @Column("event_content")
    @Comment("事情内容详情")
    @ApiModelProperty(description = "事情内容详情")
    @ColDefine(type = ColType.VARCHAR, width = 2000)
    private String eventContent;

    /**
     * 图片
     */
    @Column("event_pic_url")
    @Comment("图片")
    @ApiModelProperty(description = "图片")
    @ColDefine(type = ColType.VARCHAR, width = 2000)
    private String eventPicUrl;

    /**
     * 经度
     */
    @Column("longitude")
    @Comment("经度")
    @ApiModelProperty(description = "经度")
    @ColDefine(customType = "DECIMAL(18,6)")
    private Double longitude;

    /**
     * 维度
     */
    @Column
    @Comment("维度")
    @ApiModelProperty(description = "维度")
    @ColDefine(customType = "DECIMAL(18,6)")
    private Double latitude;

    /**
     * 备注
     */
    @Column
    @Comment("备注")
    @ApiModelProperty(description = "备注")
    @ColDefine(type = ColType.VARCHAR, width = 500)
    private String remark;

    /**
     * 事件开始时间
     */
    @Column("event_create_time")
    @Comment("事件开始时间")
    @ApiModelProperty(description = "事件开始时间")
    @ColDefine(type = ColType.TIMESTAMP, width = 6)
    private Date eventCreateTime;

    /**
     * 事件结束时间
     */
    @Column("event_complete_time")
    @Comment("事件结束时间")
    @ApiModelProperty(description = "事件结束时间")
    @ColDefine(type = ColType.TIMESTAMP, width = 6)
    private Date eventCompleteTime;

    /**
     * 事件状态
     */
    @Column("event_status")
    @Comment("事件状态")
    @ApiModelProperty(description = "事件状态")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    private String eventStatus;

    /**
     * 事件发生地址
     */
    @Column("event_address")
    @Comment("事件发生地址")
    @ApiModelProperty(description = "事件发生地址")
    @ColDefine(type = ColType.VARCHAR, width = 500)
    private String eventAddress;

    /**
     * 事件提醒
     */
    @Column("event_reminder")
    @Comment("事件提醒")
    @ApiModelProperty(description = "事件提醒")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    private String eventReminder;

    /**
     * 事情发起人电话
     */
    @Column("event_phone")
    @Comment("事情发起人电话")
    @ApiModelProperty(description = "事情发起人电话")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    private String eventPhone;

    /**
     * 事件优先级
     */
    @Column("event_priority")
    @Comment("事件优先级")
    @ApiModelProperty(description = "事件优先级")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    private String eventPriority;

    /**
     * 事件标签
     */
    @Column("event_label")
    @Comment("事件标签")
    @ApiModelProperty(description = "事件标签")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    private String eventLabel;

    /**
     * 需求内容详情类
     */
    @Column("event_content_type")
    @Comment("需求内容详情类")
    @ApiModelProperty(description = "需求内容详情类")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    private String eventContentType;

    /**
     * 显示顺序
     */
    @Column("order_by")
    @Comment("显示顺序")
    @ApiModelProperty(description = "显示顺序")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    private Integer orderBy;

    /**
     * 事件提醒状态
     */
    @Column("event_reminder_status")
    @Comment("事件提醒状态")
    @ApiModelProperty(description = "事件提醒状态")
    @ColDefine(type = ColType.VARCHAR, width = 10)
    private String eventReminderStatus;

    /**
     * 事件状态
     */
    @Column("event_sys_status")
    @Comment("事件状态")
    @ApiModelProperty(description = "事件状态")
    @ColDefine(type = ColType.VARCHAR, width = 10)
    private String eventSysStatus;

    /**
     * 事件热度
     */
    @Column("event_index")
    @Comment("事件热度")
    @ApiModelProperty(description = "事件热度")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    private String eventIndex;

    /**
     * 视频
     */
    @Column("event_vide")
    @Comment("视频")
    @ApiModelProperty(description = "视频")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    private String eventVideo;

    /**
     * 关注者
     */
    @Column("event_followers")
    @Comment("关注者")
    @ApiModelProperty(description = "关注者")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    private String eventFollowers;

    /**
     * 事件属性
     */
    @Column("event_properties")
    @Comment("事件属性")
    @ApiModelProperty(description = "事件属性")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    private String eventProperties;

    /**
     * 事件性质
     */
    @Column("event_nature")
    @Comment("事件性质")
    @ApiModelProperty(description = "事件性质")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    private String eventNature;

    /**
     * 角色（我是当事人/我是旁观者）
     */
    @Column("event_role")
    @Comment("角色（我是当事人/我是旁观者）")
    @ApiModelProperty(description = "角色（我是当事人/我是旁观者）")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    private String eventRole;

    /**
     * 置顶（是否置顶）
     */
    @Column("event_top")
    @Comment("置顶（是否置顶）")
    @ApiModelProperty(description = "置顶（是否置顶）")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    private String eventTop;

    /**
     * 省,直辖市
     */
    @Column("event_province")
    @Comment("省,直辖市")
    @ApiModelProperty(description = "省,直辖市")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    private String eventProvince;

    /**
     * 市,地级区 及同级行政区划
     */
    @Column("event_city")
    @Comment("市,地级区 及同级行政区划")
    @ApiModelProperty(description = "市,地级区 及同级行政区划")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    private String eventCity;

    /**
     * 区,县级市 及同级行政区划
     */
    @Column("event_district")
    @Comment("区,县级市 及同级行政区划")
    @ApiModelProperty(description = "区,县级市 及同级行政区划")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    private String eventDistrict;

    /**
     * 乡镇街道
     */
    @Column("event_street")
    @Comment("乡镇街道")
    @ApiModelProperty(description = "乡镇街道")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    private String eventStreet;

    /**
     * 行政区划代码
     */
    @Column("event_adcode")
    @Comment("行政区划代码")
    @ApiModelProperty(description = "行政区划代码")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    private String eventAdcode;

    /**
     * 区域类型(距离,本地,全国)
     */
    @Column("event_area_type")
    @Comment("区域类型(距离,本地,全国)")
    @ApiModelProperty(description = "区域类型(距离,本地,全国)")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    private String eventAreaType;

    @Comment("社区")
    @Column(value ="community")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    private String community;

    /**
     * 是否审核
     */
    @Column("auditing_type")
    @Comment("是否审核")
    @ApiModelProperty(description = "是否审核")
    @ColDefine(type = ColType.VARCHAR, width = 10)
    private Boolean auditingType;

    /**
     * 是否完成
     */
    @Column("complete_type")
    @Comment("是否完成")
    @ApiModelProperty(description = "是否完成")
    @ColDefine(type = ColType.VARCHAR, width = 10)
    private Boolean completeType;

    /**
     * 志愿者姓名
     */
    @Column("volunteer_name")
    @Comment("志愿者姓名")
    @ApiModelProperty(description = "志愿者姓名")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    private String volunteerName;

    /**
     * 志愿者性别
     */
    @Column("volunteer_sex")
    @Comment("志愿者性别")
    @ApiModelProperty(description = "志愿者性别")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    private String volunteerSex;

    /**
     * 志愿者手机号
     */
    @Column("volunteer_phone")
    @Comment("志愿者手机号")
    @ApiModelProperty(description = "志愿者手机号")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    private String volunteerPhone;

    /**
     * 志愿者出生年份
     */
    @Column("volunteer_year")
    @Comment("志愿者出生年份")
    @ApiModelProperty(description = "志愿者出生年份")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    private String volunteerYear;

    /**
     * 志愿者救助数量
     */
    @Column("volunteer_complete_num")
    @Comment("志愿者救助数量")
    @ApiModelProperty(description = "志愿者救助数量")
    @ColDefine(type = ColType.INT, width = 32)
    private Integer volunteerCompleteNum;

    /**
     * 信息审核通过时间
     */
    @Column("msgaudit_passTime")
    @Comment("信息审核通过时间")
    @ApiModelProperty(description = "信息审核通过时间")
    @ColDefine(type = ColType.TIMESTAMP, width = 6)
    private Date msgauditPassTime;

    /**
     * 志愿者接单时间
     */
    @Column("volunteer_ordertime")
    @Comment("志愿者接单时间")
    @ApiModelProperty(description = "志愿者接单时间")
    @ColDefine(type = ColType.TIMESTAMP, width = 6)
    private Date volunteerOrdertime;

    /**
     * 志愿者是否提供帮助
     */
    @Column("volunteer_whether_help")
    @Comment("志愿者是否提供帮助")
    @ApiModelProperty(description = "志愿者是否提供帮助")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    private String volunteerWhetherHelp;

    /**
     * 特殊需求
     */
    @Column("special_requirement")
    @Comment("特殊需求")
    @ApiModelProperty(description = "特殊需求")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    private String specialRequirement;

    /**
     * 发布者微信昵称
     */
    @Column("event_nickname")
    @Comment("发布者微信昵称")
    @ApiModelProperty(description = "发布者微信昵称")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    private String eventNickname;

    /**
     * 信息发布者性别
     */
    @Column("event_sex")
    @Comment("信息发布者性别")
    @ApiModelProperty(description = "信息发布者性别")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    private String eventSex;

    /**
     * 志愿者id
     */
    @Column("volunteer_id")
    @Comment("志愿者id")
    @ApiModelProperty(description = "志愿者id")
    @ColDefine(type = ColType.VARCHAR, width = 60)
    private String volunteerId;

    /**
     * 创建者
     */
    @Column("create_by")
    @Comment("创建者")
    @ApiModelProperty(description = "创建者")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    private String createBy;

    /**
     * 创建时间
     */
    @Column("create_time")
    @Comment("创建时间")
    @ApiModelProperty(description = "创建时间")
    @ColDefine(type = ColType.TIMESTAMP, width = 6)
    private Date createTime;

    /**
     * 更新者
     */
    @Column("update_by")
    @Comment("更新者")
    @ApiModelProperty(description = "更新者")
    @ColDefine(type = ColType.VARCHAR, width = 255)
    private String updateBy;

    /**
     * 更换时间
     */
    @Column("update_time")
    @Comment("更换时间")
    @ApiModelProperty(description = "更换时间")
    @ColDefine(type = ColType.TIMESTAMP, width = 6)
    private Date updateTime;

    /**
     * 删除标记
     */
    @Column("del_flag")
    @Comment("删除标记")
    @ApiModelProperty(description = "删除标记")
    @ColDefine(type = ColType.BOOLEAN, width = 2)
    private Boolean delFlag;

    @Column("show_flag")
    @Comment("展示标记")
    @ApiModelProperty(description = "展示标记")
    @ColDefine(type = ColType.INT, width = 2)
    private Integer showFlag;

    @Column("file_url")
    @Comment("文档路径")
    @ApiModelProperty(description = "文档路径")
    private String fileUrl;
    /**
     * 事件离我的距离
     */
    private Double distanceForMe;

    /**
     * 事件离我的距离
     */
    private String distanceMe;

    /**
     * 是否首页显示
     */
    private Boolean isDisplay;

    private String loginOpenid;

    private String sqlString;


    public String nextId() {
        return IdUtil.getSnowflake(2, 2).nextIdStr();

    }
}
